from selenium.webdriver.common.by import By

class AdminDataDeletionCreDataLocator:
    # Data Deletion 菜单
    data_deletion_menu = (By.XPATH, "//div[contains(@data-menu-id,'DATA_DELETION')]")
    # CRE Data菜单
    cre_data_menu = (By.CSS_SELECTOR, '[path="/console/singleCreData"]')
    # CRE&ASCM Data菜单
    cre_ascm_data_menu = (By.CSS_SELECTOR, '[path="/console/creData"]')
    no_permission = (By.XPATH, '//h1[text() = "403"]')

    # CRE Data列表属性
    # Account Email
    record_list_account_email = (By.XPATH, '//th[text() = "Account Email"]')
    # status
    record_list_status = (By.XPATH, '//span[text() = "Status"]')
    # Creation Time
    record_list_create_time = (By.XPATH, '//th[text() = "Creation Time (UTC+08:00)"]')
    # Payment Mode
    record_list_payment_mode = (By.XPATH, '//span[text() = "Payment Mode"]')
    # Available Balance
    record_list_available_balance = (By.XPATH, '//th[text() = "Available Balance"]')
    # Outstanding Amount
    record_list_outstanding_amount = (By.XPATH, '//th[text() = "Outstanding Amount"]')
    # Account Type
    record_list_account_type = (By.XPATH, '//span[text() = "Account Type"]')
    # User Name
    record_list_user_name = (By.XPATH, '//th[text() = "User Name"]')
    # Importer
    record_list_importer = (By.XPATH, '//th[text() = "Importer"]')
    # Import Time
    record_list_import_time = (By.XPATH, '//th[text() = "Import Time (UTC+08:00)"]')

    ##页面提示语
    #问号
    question_hit = (By.XPATH, "//span[contains(@class,'anticon anticon-question-circle')]")
    question_hit_content = (By.XPATH, '//div[text() = "CRE Data refers to the data of the main user dimension in CRE, which includes the order, bill, account, message notification, etc. of the main user of CRE."]')
    #下载说明
    download_hit_content = (By.XPATH, '//div[text() = "Please download the template for data import first, and upload the Excel for import after filling in."]')

    #搜索条件
    search_type = (By.XPATH, "//span[contains(@class,'antd4-select-selection-item')]")
    search_type_account_email = (By.XPATH, '(//div[contains(@class,"antd4-select-item-option-content")])[1]')
    search_type_user_name = (By.XPATH, '(//div[contains(@class,"antd4-select-item-option-content")])[2]')
    search_type_importer = (By.XPATH, '(//div[contains(@class,"antd4-select-item-option-content")])[3]')
    #搜索输入框
    search_input = (By.XPATH, "//input[@class='antd4-input']")
    #搜索按钮
    search_button = (By.XPATH, '//span[text() = "Search"]')
    #reset按钮
    reset_button = (By.XPATH, '//span[text() = "Reset"]')

    # 第一个查询结果
    first_search_result = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[2]')
    # 第一个查询结果的account email的值
    first_search_result_account_email = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[2]')
    # 第一个查询结果的status的值
    first_search_result_status = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[3]')
    first_search_result_create_time = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[4]')
    first_search_result_payment_mode = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[5]')
    first_search_result_available_balance = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[6]')
    first_search_result_outstanding_amount = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[7]')
    first_search_result_account_type = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[8]')
    first_search_result_user_name = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[9]')
    first_search_result_importer = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[10]')
    first_search_result_import_time = (By.XPATH, '(//tr[contains(@class,"antd4-table-row antd4-table-row-level-0")])[1]//td[11]')


    #查询结果的数据量
    search_result_num = (By.XPATH, "//li[contains(@class,'antd4-pagination-total-text')]")

    #筛选
    #状态筛选
    status_filter_button = (By.XPATH, "//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')]")
    status_filter_undeleted_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="Undeleted"]')
    status_filter_deleting_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="Deleting"]')
    status_filter_abnormal_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="Abnormal"]')
    status_filter_deleted_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="Deleted"]')
    status_filter_ok_button = (By.XPATH, '(//span[text()="OK"])[1]')
    status_filter_reset_button = (By.XPATH, '(//span[text()="Reset"])[2]')
    # 支付模式筛选
    pm_filter_button = (By.XPATH, "(//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')])[2]")
    pm_filter_ok_button = (By.XPATH, '(//span[text()="OK"])[2]')
    pm_filter_reset_button = (By.XPATH, '(//span[text()="Reset"])[3]')
    pm_filter_pre_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="PrePaid"]')
    pm_filter_post_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="PostPaid"]')
    # 账号类型筛选
    account_filter_button = (By.XPATH, "(//span[contains(@class,'antd4-dropdown-trigger antd4-table-filter-trigger')])[3]")
    account_filter_ok_button = (By.XPATH, '(//span[text()="OK"])[3]')
    account_filter_reset_button = (By.XPATH, '(//span[text()="Reset"])[4]')
    account_filter_pre_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="Enterprise"]')
    account_filter_post_button = (By.XPATH, '//span[contains(@class,"antd4-dropdown-menu-title-content")]/span[text()="Personal"]')

    # log 按钮
    log_button = (By.XPATH, '(//span[text()="Log"])')

    #log详情页面
    #Basic Information
    log_detail_title_bi = (By.XPATH, '(//div[text()="Basic Information"])')
    #Operational Information
    log_detail_title_oi = (By.XPATH, '(//div[text()="Operational Information"])')
    #Data Deletion Detail
    log_detail_title_ddd = (By.XPATH, '(//div[text()="Data Deletion Detail"])')

    #log详情页面属性
    # Basic Information
    # log_detail_account_email = (By.XPATH, '(//div[text()="Account Email"])')
    # log_detail_status = (By.XPATH, '(//div[text()="Status"])')
    # log_detail_creation_time = (By.XPATH, '(//div[text()="Creation Time (UTC+08:00)"])')
    # log_detail_payment_mode = (By.XPATH, '(//div[text()="Payment Mode"])')
    # log_detail_available_balance = (By.XPATH, '(//div[text()="Available Balance"])')
    # log_detail_oustanding_amount = (By.XPATH, '(//div[text()="Outstanding Amount"])')
    # log_detail_account_type = (By.XPATH, '(//div[text()="Account Type"])')
    # log_detail_user_name = (By.XPATH, '(//div[text()="User Name"])')
    # log_detail_importer = (By.XPATH, '(//div[text()="Importer"])')
    # log_detail_importer_time = (By.XPATH, '(//div[text()="Import Time (UTC+08:00)"])')
    log_detail_account_email = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[1]/div/span[2]")
    log_detail_status = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[2]/div/span[2]/span/span[2]")
    log_detail_creation_time = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[3]/div/span[2]")
    log_detail_payment_mode = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[4]/div/span[2]")
    log_detail_available_balance = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[5]/div/span[2]")
    log_detail_oustanding_amount = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[6]/div/span[2]")
    log_detail_account_type = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[7]/div/span[2]")
    log_detail_user_name = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[8]/div/span[2]")
    log_detail_importer = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[9]/div/span[2]")
    log_detail_importer_time = (By.XPATH, "(//td[contains(@class,'antd4-descriptions-item cre-descriptions-item')])[10]/div/span[2]")

    # Operational Information
    log_detail_oi_operation_id = (By.XPATH, '(//th[text()="Operation ID"])')
    log_detail_oi_operator = (By.XPATH, '(//th[text()="Operator"])')
    log_detail_oi_operator_ip = (By.XPATH, '(//th[text()="Operator IP"])')
    log_detail_oi_operation_time = (By.XPATH, '(//th[text()="Operation Time (UTC+08:00)"])')
    log_detail_oi_operation_result = (By.XPATH, '(//th[text()="Operation Result"])')
    log_detail_oi_operation_num = (By.XPATH, "//div[contains(@class,'antd4-table antd4-table-scroll-horizontal')]/../ul/li")

    # Data Deletion Detail
    log_detail_ddd_operation_id = (By.XPATH, '(//span[text()="Operation ID"])')
    log_detail_ddd_data_type = (By.XPATH, '(//th[text()="Data Type"])')
    log_detail_ddd_value = (By.XPATH, '(//th[text()="Value"])')
    log_detail_ddd_status = (By.XPATH, '(//span[text()="Status"])')
    log_detail_ddd_start_time = (By.XPATH, '(//th[text()="Start Time (UTC+08:00)"])')
    log_detail_ddd_end_time = (By.XPATH, '(//th[text()="End Time (UTC+08:00)"])')
    log_detail_ddd_operation_num = (By.XPATH, "//div[contains(@class,'antd4-table antd4-table-ping-right antd4-table-scroll-horizontal')]/../ul/li")












